package org.batatasframework.properties.macro;

/**
 * 宏指令，宏指令是在整个处理过程开始前被执行的
 * @author jackson
 *
 */
public class MacroCommand {
	private final String name;
	private final MacroCommandHandler handler;
	
	public MacroCommand(String name, MacroCommandHandler handler){
		this.name = name;
		this.handler = handler;
	}
	
	public int length(){
		return name.length();
	}
	
//	public boolean execute(String comm){
//		if(comm.startsWith(name)){
//			String value = comm.substring(name.length() + 1);
//			handler.execute(this, value);
//			
//			return true;
//		}
//		return false;
//	}
	
	public MacroCommandHandler getHandler() {
		return handler;
	}
}
